﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Oplaco.Core.BusinessLogicLayer
{
    public sealed class GlobalInformationSystem
    {
        #region IGlobalInformationSystem Property

        public string URL
        {
            get;
            set;
        }

        public GisType GisType
        {
            get;
            set;
        }

        public string Streetname
        {
            get;
            set;
        }

        public string City
        {
            get;
            set;
        }

        public string Region
        {
            get;
            set;
        }

        public int PostalCode
        {
            get;
            set;
        }

        public string PostalExtension
        {
            get;
            set;
        }

        public string Country
        {
            get;
            set;
        }

        public int houseNumber
        {
            get;
            set;
        }

        public string houseNumberExtension
        {
            get;
            set;
        }

        public string longtitude
        {
            get;
            set;
        }

        public string latitude
        {
            get;
            set;
        }
        #endregion

        public GlobalInformationSystem()
        {
            this.Country = "Netherlands";
        }

        public GlobalInformationSystem Create(GisType type, int postalcode, string postalcodeextension, string city)
        {
            GlobalInformationSystem GIS = new GlobalInformationSystem();

            GIS.City = city;
            GIS.GisType = type;
            GIS.PostalCode = postalcode;
            GIS.PostalExtension = postalcodeextension;

            return GIS;
        }

        /*public net.mappoint.service.FindResults GeoCodeAddress(string address, string city, string state, string zip, string country)
        {
            RenderServiceSoap render = new RenderServiceSoap();
            render.PreAuthenticate = true;
            render.Credentials = myCredentials;
            render.Url = "http://renderv3.staging.mappoint.net/Render-30/RenderService.asmx";


            LatLong latLon = new LatLong();

            net.mappoint.service.Address myAddress = new net.mappoint.service.Address();

            myAddress.AddressLine = address;

            myAddress.PrimaryCity = city;

            myAddress.Subdivision = state;

            myAddress.PostalCode = zip;

            myAddress.CountryRegion = country;

            FindAddressSpecification findAddressSpec = new FindAddressSpecification();

            findAddressSpec.DataSourceName = "MapPoint.NA";

            findAddressSpec.InputAddress = myAddress;

            findAddressSpec.Options = new FindOptions();

            findAddressSpec.Options.ThresholdScore = .9;

            findAddressSpec.Options.Range = new FindRange();

            findAddressSpec.Options.Range.Count = 30;

            GeoCodeService.net.mappoint.service.FindResults myResults = FindService.FindAddress(findAddressSpec);

            return myResults;

        }*/
    }
}
